package io.bigbird0101.order.business.service.controller;

import io.bigbird0101.order.business.service.dto.OrderDto;
import io.bigbird0101.order.business.service.impl.OrderService;
import io.bigbird0101.order.business.service.vo.OrderVo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author bigbird-0101
 * @date 2024-04-11 22:51
 */
@RestController("/order")
@RequiredArgsConstructor
public class OrderController {
    private final OrderService orderService;
    @PostMapping
    public OrderVo createOrder(OrderDto order) {
        return orderService.createOrder(order);
    }

    @GetMapping
    public OrderVo getOrderById(Long id) {
        return orderService.getOrderById(id);
    }
}
